Skip to content

fix(faro): Block private IPs on sourcemap downloads - #6849

Open
SashaMIT wants to merge 1 commit into
grafana:mainfrom
SashaMIT:fix/faro-sourcemap-ssrf
Open

fix(faro): Block private IPs on sourcemap downloads#6849
SashaMIT wants to merge 1 commit into
grafana:mainfrom
SashaMIT:fix/faro-sourcemap-ssrf

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Aug 8, 2026

Copy link
Copy Markdown

Brief description of Pull Request

faro.receiver sourcemap downloads now reject loopback / RFC1918 / link-local / CGNAT targets, re-check download_from_origins against the resolved absolute sourceMappingURL, and validate redirect hops via CheckRedirect. Tests added in internal/component/faro/receiver.

Pull Request Details

(HUMAN ONLY, write in your voice. Starting point: the default config, download=true with download_from_origins=["*"], means a stock Alloy deployment accepts faro signals from any client and fetches whatever sourcemap URL the signal points at. I treated the fetch as server-side because the pod's network position is what makes internal targets reachable. I chose a deny-list of private ranges plus redirect re-validation rather than an allow-list so public CDN sourcemaps keep working when origins permit them.)

Issue(s) fixed by this Pull Request

Fixes #6870

Notes to the Reviewer

Happy to discuss whether the private-range deny should be configurable. I kept it hard-coded because the default config is open to any client.

PR Checklist

  • Documentation added
  • Tests updated
  • Config converters updated
  • This pull request was substantially generated with AI assistance (see the GenAI policy)

faro.receiver sourcemap download used a bare http.Client with default
download_from_origins=["*"], so client-controlled Filename /
sourceMappingURL values could reach loopback, RFC1918, link-local, and
CGNAT addresses. Reject blocked addresses before Get, re-check origin
allowlist on resolved sourceMappingURL, and validate redirect hops.
@SashaMIT
SashaMIT requested a review from a team as a code owner August 8, 2026 16:12
@cla-assistant

cla-assistant Bot commented Aug 8, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@kalleep

kalleep commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Hey a couple of things. Before making pr please create a issue and describe what the problem actually is, second please read our AI policy and please use the pr template that we have in alloy.

@SashaMIT SashaMIT changed the title fix(faro): block private IPs on sourcemap downloads fix(faro): Block private IPs on sourcemap downloads Aug 12, 2026
@SashaMIT

Copy link
Copy Markdown
Author

You're right on all three, thanks for the pointers. I've read the GenAI policy. I've opened #6870 describing the problem and linked it, and reworked the PR body into the alloy template with the AI-assistance box checked. Details and reviewer notes are in my own words.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

faro.receiver sourcemap download fetches client-influenced URLs with no private-IP or redirect validation

2 participants